package com.example.servicea.main;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test1 {

    // 卖票  100 票
    // 5个窗口一起卖

    // 1.2 号窗口同时卖票,1  <1, 1号 2号 都卖一张票, -1


    public static void main(String[] args) {

        MaiPiao maipiao = new MaiPiao(100);

        ExecutorService executorService = Executors.newFixedThreadPool(5);
        executorService.execute(maipiao);
        executorService.execute(maipiao);
        executorService.execute(maipiao);
        executorService.execute(maipiao);
        executorService.execute(maipiao);

    }

}
